// **************************************************************
// Com ++ Framework by the C++ World
// Please report defects: mailto:compp@cplusplusworld.com
// Please visit: http://www.cplusplusworld.com/socketlibrary.html
// **************************************************************

#include <iostream>
#include <cstdlib>
#include "ComPlusPlus/ComPlusPlus"

#include <string>

class Clone1 : public compp::Clone {

 int Run ( ) {
   while ( true ) {
    syspp::Call::Sleep(1);
    std::cout << "**Clone \n";
   }
  return 0; // Hi Lint
 }

};
int main (int argc, char *argv [] ) {
try {	
  int loops = 15;
  Clone1 *C1 = new Clone1();
  C1->SetAutoTerm(true);
  C1->Start();
  
  while ( loops-- != 0 ) {
    syspp::Call::Sleep(1);
    std::cout << "**Parent \n";
    std::cout << loops << " Rounds to finish\n";
  }
  delete C1;

} catch ( syspp::ComException e ) {
	std::cout <<  "Exception " << e.what() << "\n" ;	
}
 return 0;	
}
